
#ifndef _MEMBER_BMESH_H_
#define _MEMBER_BMESH_H_

#include <BVectorArray>
#include <BFaceArray>
#include <BColorArray>
#include <BCoordArray>
#include <BFaceArray>
#include <BTexture>
#include <BMaterial>
#include <BProgram>
#include <BMesh>

#include <BOctTree>

#define mesh_member(mesh)		((member_BMesh*)((BMesh*)mesh)->_ptr)

namespace BWE
{
	typedef BOctTree<BFaceArray>			FaceOctTree;
	typedef BOctTree<BFaceArray>::Item		FaceOctTreeItem;
	typedef BOctTree<BFaceArray>::ItemArray	FaceOctTreeItemArray;

	class member_BMesh : public BObject
	{
		friend class BMesh;
	public:
		member_BMesh(BMesh* mesh);
		~member_BMesh();

		void slotFreshFaceOctTree();

		BMesh*						boss;
		BHolder<BVectorArray>		vertices;
		BHolder<BVectorArray>		normals;
		BHolder<BColorArray>		colors;
		BArray<BCoordArrayHolder>	coords;
		BHolder<BFaceArray>			faces;
		BHolder<FaceOctTree>		faceOctTree;
	};
}

#endif